package Mmethod;

import book.booklist;

import java.util.Scanner;

public class returnbook implements gather{
    @Override
    public void work(booklist book) {
        System.out.println("请输入要归还的书籍的名称：");
        Scanner sacn=new Scanner(System.in);
        String name= sacn.nextLine();
        for(int i=0;i<book.getBookcontent();i++){
            if (name.equals(book.getarr(i).getName())){
                book.getarr(i).setState(false);
                System.out.println("归还成功");
                return;
            }
        }
        System.out.println("找不到这本书");
    }
}
